package com.chd.driversystem.gen;

import java.util.Map;

import org.greenrobot.greendao.AbstractDao;
import org.greenrobot.greendao.AbstractDaoSession;
import org.greenrobot.greendao.database.Database;
import org.greenrobot.greendao.identityscope.IdentityScopeType;
import org.greenrobot.greendao.internal.DaoConfig;

import com.chd.driversystem.domain.Assignment;
import com.chd.driversystem.domain.DrivingRecord;
import com.chd.driversystem.domain.Evaluation;
import com.chd.driversystem.domain.Oil;
import com.chd.driversystem.domain.Operation;
import com.chd.driversystem.domain.Ranking;
import com.chd.driversystem.domain.Team;
import com.chd.driversystem.domain.User;
import com.chd.driversystem.domain.Vehicle;

import com.chd.driversystem.gen.AssignmentDao;
import com.chd.driversystem.gen.DrivingRecordDao;
import com.chd.driversystem.gen.EvaluationDao;
import com.chd.driversystem.gen.OilDao;
import com.chd.driversystem.gen.OperationDao;
import com.chd.driversystem.gen.RankingDao;
import com.chd.driversystem.gen.TeamDao;
import com.chd.driversystem.gen.UserDao;
import com.chd.driversystem.gen.VehicleDao;

// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.

/**
 * {@inheritDoc}
 * 
 * @see org.greenrobot.greendao.AbstractDaoSession
 */
public class DaoSession extends AbstractDaoSession {

    private final DaoConfig assignmentDaoConfig;
    private final DaoConfig drivingRecordDaoConfig;
    private final DaoConfig evaluationDaoConfig;
    private final DaoConfig oilDaoConfig;
    private final DaoConfig operationDaoConfig;
    private final DaoConfig rankingDaoConfig;
    private final DaoConfig teamDaoConfig;
    private final DaoConfig userDaoConfig;
    private final DaoConfig vehicleDaoConfig;

    private final AssignmentDao assignmentDao;
    private final DrivingRecordDao drivingRecordDao;
    private final EvaluationDao evaluationDao;
    private final OilDao oilDao;
    private final OperationDao operationDao;
    private final RankingDao rankingDao;
    private final TeamDao teamDao;
    private final UserDao userDao;
    private final VehicleDao vehicleDao;

    public DaoSession(Database db, IdentityScopeType type, Map<Class<? extends AbstractDao<?, ?>>, DaoConfig>
            daoConfigMap) {
        super(db);

        assignmentDaoConfig = daoConfigMap.get(AssignmentDao.class).clone();
        assignmentDaoConfig.initIdentityScope(type);

        drivingRecordDaoConfig = daoConfigMap.get(DrivingRecordDao.class).clone();
        drivingRecordDaoConfig.initIdentityScope(type);

        evaluationDaoConfig = daoConfigMap.get(EvaluationDao.class).clone();
        evaluationDaoConfig.initIdentityScope(type);

        oilDaoConfig = daoConfigMap.get(OilDao.class).clone();
        oilDaoConfig.initIdentityScope(type);

        operationDaoConfig = daoConfigMap.get(OperationDao.class).clone();
        operationDaoConfig.initIdentityScope(type);

        rankingDaoConfig = daoConfigMap.get(RankingDao.class).clone();
        rankingDaoConfig.initIdentityScope(type);

        teamDaoConfig = daoConfigMap.get(TeamDao.class).clone();
        teamDaoConfig.initIdentityScope(type);

        userDaoConfig = daoConfigMap.get(UserDao.class).clone();
        userDaoConfig.initIdentityScope(type);

        vehicleDaoConfig = daoConfigMap.get(VehicleDao.class).clone();
        vehicleDaoConfig.initIdentityScope(type);

        assignmentDao = new AssignmentDao(assignmentDaoConfig, this);
        drivingRecordDao = new DrivingRecordDao(drivingRecordDaoConfig, this);
        evaluationDao = new EvaluationDao(evaluationDaoConfig, this);
        oilDao = new OilDao(oilDaoConfig, this);
        operationDao = new OperationDao(operationDaoConfig, this);
        rankingDao = new RankingDao(rankingDaoConfig, this);
        teamDao = new TeamDao(teamDaoConfig, this);
        userDao = new UserDao(userDaoConfig, this);
        vehicleDao = new VehicleDao(vehicleDaoConfig, this);

        registerDao(Assignment.class, assignmentDao);
        registerDao(DrivingRecord.class, drivingRecordDao);
        registerDao(Evaluation.class, evaluationDao);
        registerDao(Oil.class, oilDao);
        registerDao(Operation.class, operationDao);
        registerDao(Ranking.class, rankingDao);
        registerDao(Team.class, teamDao);
        registerDao(User.class, userDao);
        registerDao(Vehicle.class, vehicleDao);
    }
    
    public void clear() {
        assignmentDaoConfig.clearIdentityScope();
        drivingRecordDaoConfig.clearIdentityScope();
        evaluationDaoConfig.clearIdentityScope();
        oilDaoConfig.clearIdentityScope();
        operationDaoConfig.clearIdentityScope();
        rankingDaoConfig.clearIdentityScope();
        teamDaoConfig.clearIdentityScope();
        userDaoConfig.clearIdentityScope();
        vehicleDaoConfig.clearIdentityScope();
    }

    public AssignmentDao getAssignmentDao() {
        return assignmentDao;
    }

    public DrivingRecordDao getDrivingRecordDao() {
        return drivingRecordDao;
    }

    public EvaluationDao getEvaluationDao() {
        return evaluationDao;
    }

    public OilDao getOilDao() {
        return oilDao;
    }

    public OperationDao getOperationDao() {
        return operationDao;
    }

    public RankingDao getRankingDao() {
        return rankingDao;
    }

    public TeamDao getTeamDao() {
        return teamDao;
    }

    public UserDao getUserDao() {
        return userDao;
    }

    public VehicleDao getVehicleDao() {
        return vehicleDao;
    }

}
